import { NgModule } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'
import { ManualAuthListComponent } from './list/list.component'
import { NewManualAuthComponent } from './new/new.component'
import { NewRouterGuardClass } from '@shared/classes/NewRouterGuardClass'
import { ListReuseGuardClass } from '@shared/classes/ListReuseGuardClass'

const routes: Routes = [
  { path: '', redirectTo: 'list', pathMatch: 'full' },
  {
    path: 'list',
    component: ManualAuthListComponent,
    canActivate: [ListReuseGuardClass],
    data: {
      breadcrumb: 'OPERATION.MANUAL_AUTH.LIST',
      title: '手工授权列表',
      titleI18n: 'OPERATION.MANUAL_AUTH.LIST',
      pathMatch: 'full',
      reuse: true,
    },
  },
  {
    path: 'new',
    component: NewManualAuthComponent,
    canDeactivate: [NewRouterGuardClass],
    data: {
      breadcrumb: 'GENERAL.INFO.BREADCRUMB.CREATE',
      title: '新增',
      titleI18n: 'GENERAL.INFO.BREADCRUMB.CREATE',
      pathMatch: 'full',
    },
  },
]

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class ManualAuthRoutingModule {}
